#-*-coding=UTF-8-*-
#import requests
import json
import urllib
import urllib2
# (Request-Line)	POST /member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1 HTTP/1.1
#Host	www.znczz.com

#User-Agent	Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0

#Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

#Accept-Language	en-US,en;q=0.5

#Accept-Encoding	gzip, deflate

#Referer	http://www.znczz.com/

#Cookie	djpk_2132_saltkey=xwD7kW3j; djpk_2132_lastvisit=1477143871; djpk_2132_sid=M9Rl39; djpk_2132_lastact=1477147592%09home.php%09misc; djpk_2132_sendmail=1; Hm_lvt_6656a691b92410ab8e491ed238ce79c0=1477147479,1477147594; Hm_lpvt_6656a691b92410ab8e491ed238ce79c0=1477147594; __utma=117868738.1664606140.1477147479.1477147479.1477147479.1; __utmb=117868738.2.10.1477147479; __utmc=117868738; __utmz=117868738.1477147479.1.1.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmt=1

#Content-Type	application/x-www-form-urlencoded

#Content-Length	91'
#fastloginfield=username&username=whu_ysw&password=ysw19951017&quickforward=yes&handlekey=ls
user_name = r'whu_ysw'
user_password = r'ysw19951017'
des_url = r'http://www.znczz.com'

postData={'fastloginfield': 'username',
'username': user_name,
'password': user_password,
'quickforward': 'yes',
'handlekey': 'ls'
}
headers = {'User-Agent': r'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0',
'Host': r'www.znczz.com',
'Accept': r'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': r'en-US,en;q=0.5',
'Accept-Encoding': r'gzip, deflate',
'Referer': r'http://www.znczz.com/'}
#result = requests.post(des_url,postData=postData,headers=headers)
#result = requests.post(des_url,postData=postData)
postData = urllib.urlencode(postData)
request0 = urllib2.Request(des_url,postData,headers)
response = urllib2.urlopen(request0)
status = response.getcode()
print status
